#-*- coding:utf-8 -*-

import requests;
from lxml import etree;
import time;
import re;
import mysql.connector;
import uuid;

conn=mysql.connector.connect(user='root',password='123456',database='jiang');
cursor=conn.cursor();

header={'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1'};
proxies={
	"http":"http://139.224.135.94:80",	
	"http":"http://110.72.43.198:8123",	
	"http":"http://121.205.254.170:39581",	
	
};
start_url='https://m.lianjia.com/cd/xiaoqu/pg';
url='https://m.lianjia.com/cd/chengjiao/c3011055396081or1pg6';

html=requests.get(url,headers=header,proxies=proxies);
selector=etree.HTML(html.text);
nohouse=selector.xpath('//li[@class="house_none"]');
xiaoquList=selector.xpath('//div[@class="item_list"]');

print(len(xiaoquList));

for xiaoqu in xiaoquList:
	total_price=xiaoqu.xpath('div[4]/span[1]/em[1]/text()');
	print(total_price);


